<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <h4>js 面向对象，动态添加标签页</h4>
  <div class="con" id="tab">
    <header>
      <ul class="ul">
        <li class="li-style">测试1<span class="jian">-</span></li>
        <li>测试2<span class="jian">-</span></li>
      </ul>
      <div class="tebadd">
        <h1 class="jia">+</h1>
      </div>
    </header>
    <div class="main">
      <section class="con-style">测试1</section>
      <section>测试2</section>
    </div>
  </div>
</body>
<script src="./copy-table.js"></script>
</html>

<style>
  * {
    padding: 0px;
    margin: 0;
    text-align: center;
    margin: 0 auto;
  }

  h4 {
    margin: 20px;
  }

  .con {
    width: 60%;
    height: 80vh;
    border: 1px solid black;
    padding: 4px 20px;
  }

  ul li {
    float: left;
    list-style: none;
    border: 1px solid red;
    margin: 3px 6px;
  }

  .tebadd {
    float: right;
    cursor: pointer;
  }

  ul {
    float: left;
  }

  header {
    overflow: hidden;
  }

  .main {
    border: 1px solid red;
    height: 70vh;
  }

  .jian {
    border: 1px solid black;
    margin: 6px;
    display: inline-block;
    height: 20px;
    width: 20px;
    cursor: pointer;
    margin-left: 20px;
  }

  section {
    display: none;
    width: 100%;
    height: 100%;
  }

  header ul li {
    cursor: pointer;
  }

  .li-style {
    background-color: #d9d9d9;
    cursor: alias;
  }

  .con-style {
    display: block;
    background-color: #d9d9d9;
  }
</style>